package model;


import java.io.Serializable;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

import model.objects.EdiLine;
import model.objects.EdiStation;
import model.objects.EdiTransfer;
import model.objects.EdiTunnel;

import com.nightpiter.model.MetroModelData;
import com.nightpiter.model.objects.Hub;
import com.nightpiter.model.objects.Line;
import com.nightpiter.model.objects.Station;
import com.nightpiter.model.objects.Transfer;
import com.nightpiter.model.objects.Tunnel;

/**
 * @author Eldar Abusalimov (eldar.abusalimov@gmail.com)
 */
public class EditorMetroModelData extends MetroModelData {

	EditorMetroModelData() {
		super();
		// TODO Auto-generated constructor stub
	}



	private static final long serialVersionUID = -7651840119072826001L;

	/** the name of the city represented in this Model */
	private String cityName;

	/** comment to this Model */
	private String comment;

	/** authors' names */
	private ArrayList<String> authors;

	/** the underground stations */
	private List<EdiStation> stations;

	
	/** the underground lines */
	private ArrayList<EdiLine> lines;

	/** the underground transfers */
	private List<EdiTransfer> transfers;

	/** the underground tunnels */
	private List<EdiTunnel> tunnels;

	/**
	 * default package protected constructor
	 */
	/*EditorMetroModelData() {		
		this.stations = new ArrayList<EdiStation>();
		this.transfers = new ArrayList<EdiTransfer>();
		this.tunnels = new ArrayList<EdiTunnel>();
		this.hubs = new ArrayList<Hub>();
		this.lines = new ArrayList<Line>();
		this.cityName = "";
		this.authors = new ArrayList<String>();
		this.comment = "";
	}*/

	/**
	 * package protected constructor (should be called from MetroModelBuilder's
	 * build method)
	 * 
	 * @param stations2
	 *            the underground stations
	 * @param transfers2
	 *            the underground transfers
	 * @param tunnels2
	 *            the underground tunnels
	 * @param hubs
	 *            the underground hubs ("linked" transfers)
	 * @param lines
	 *            the underground lines ("linked" tunnels)
	 * @param cityName
	 *            the name of the city represented in this Model
	 * @param authors
	 *            the authors of this model
	 * @param comment
	 *            the comment to set
	 * @return 
	 */
	public EditorMetroModelData(List<EdiStation> stations2, List<EdiTransfer> transfers2,
			List<EdiTunnel> tunnels2, ArrayList<Hub> hubs,
			ArrayList<EdiLine> lines, String cityName, ArrayList<String> authors,
			String comment) {
		
		this.stations = stations2;
		this.transfers = transfers2;
		this.tunnels = tunnels2;
		this.hubs = hubs;
		this.lines = lines;
		this.cityName = cityName;
		this.authors = authors;
		this.comment = comment;
	}

	/**
	 * @return the authors
	 */
	public ArrayList<String> getAuthors() {
		return authors;
	}

	/**
	 * @return the comment
	 */
	public String getComment() {
		return comment;
	}

	/**
	 * @return the cityName
	 */
	public String getCityName() {
		return cityName;
	}

	/**
	 * @return the stations
	 */
	public List<EdiStation> getEdiStations() {		
		return stations;
	}
	
	/**
	 * @return the lines
	 */
	public ArrayList<EdiLine> getEdiLines() {		
		return lines;
	}

	/**
	 * @return the transfers
	 */
	public List<EdiTransfer> getEdiTransfers() {
		return transfers;
	}

	/**
	 * @return the tunnels
	 */
	public List<EdiTunnel> getEdiTunnels() {
		return tunnels;
	}

	public ArrayList<Station> getStations() {		
		ArrayList<Station> r = new ArrayList<Station>();
		for(Station t: stations) {
			r.add(t);
		}
		return r;
	}

	/**
	 * @return the transfers
	 */
	public ArrayList<Transfer> getTransfers() {
		ArrayList<Transfer> r = new ArrayList<Transfer>();
		for(Transfer t: transfers) {
			r.add(t);
		}
		return r;
	}

	/**
	 * @return the tunnels
	 */
	public ArrayList<Tunnel> getTunnels() {
		ArrayList<Tunnel> r = new ArrayList<Tunnel>();
		for(Tunnel t: tunnels) {
			r.add(t);
		}
		return r;
	}
		
	

	/**
	 * @return the lines
	 */
	public ArrayList<Line> getLines() {
		ArrayList<Line> r = new ArrayList<Line>();
		for(Line l: lines) {
			r.add(l);
		}
		return r;
	}
	
	

}
